title: compilation with Makefile fail but success in command line
body: <p>I was using a Makefile to compile my project and compiled successfully, but when I added a new lib (libbcm2835.a) to linker (-lbcm2835) it fails, otherwise when using the following commands it compile and link with no error :</p>
  
  <pre><code>gcc -c ihome_*.c
  gcc -o iHome_Start ihome*.o -lbcm2835 -lpthread
  </code></pre>
  
  <p>Makefile : </p>
  
  <pre><code># project name (generate executable with this name)
  TARGET   = iHome_Start
  
  CC       = gcc
  # compiling flags here
  CFLAGS   = -std=c99 -Wall -I.
  
  LINKER   = gcc -o
  # linking flags here
  LFLAGS   = -lpthread -lbcm2835
  
  # change these to set the proper directories where each files shoould be
  SRCDIR   = .
  OBJDIR   = .
  BINDIR   = .
  
  SOURCES  := $(wildcard $(SRCDIR)/*.c)
  INCLUDES := $(wildcard $(SRCDIR)/*.h)
  OBJECTS  := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
  rm       = rm -f
  
  
  $(BINDIR)/$(TARGET): $(OBJECTS)
      @$(LINKER) $@ $(LFLAGS) $(OBJECTS)
      @echo "Linking complete!"
  
  $(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
      @$(CC) $(CFLAGS) -c $&lt; -o $@
      @echo "Compiled "$&lt;" successfully!"
  
  .PHONEY: clean
  clean:
      @$(rm) $(OBJECTS)
      @echo "Cleanup complete!"
  
  .PHONEY: remove
  remove: clean
      @$(rm) $(BINDIR)/$(TARGET)
      @echo "Executable removed!"
  </code></pre>