title: Makefile can't find a target that is already there
body: <p>So I've got the following folder structure</p>
  
  <pre><code>makefile
  src/my_lib.c
  src/myhead.h
  </code></pre>
  
  <p>and I'm trying to compile *my_lib.c* with the header <em>myhead.h</em> as a library. This is the <em>makefile</em>. I attempt to put the <em>obj</em> files in <em>OBJFOLDER</em> and the compiled library in the <em>OUTPUTFOLDER</em></p>
  
  <pre><code>PLUGNAME=my_lib
  
  SOURCEFOLDER=src
  OUTPUTFOLDER=bin
  OBJFOLDER=bin/obj
  
  OBJS=$(PLUGNAME).o
  DEPS=myhead.h
  
  # Configuration finishes here
  
  _OBJS = $(patsubst %,$(OBJFOLDER)/%,$(OBJS))
  _DEPS = $(patsubst %,$(SOURCEFOLDER)/%,$(DEPS))
  
  ifeq ($(OS),Windows_NT)
      EXT = .dll
  else
      UNAME_S := $(shell uname -s)
      ifeq ($(UNAME_S),Linux)
          EXT = .so
      endif
  endif
  
  all : $(OUTPUTFOLDER)/$(PLUGNAME)$(EXT)
  
  $(OUTPUTFOLDER)/$(PLUGNAME)$(EXT) : $(_OBJS)
      gcc -Wl,--add-stdcall-alias -shared -o $@ $(_OBJS)
  
  $(OBJFOLDER)/%.o: $(SOURCEFOLDER)/%.c $(_DEPS)
      mkdir -p $(OUTPUTFOLDER)
      mkdir -p $(OBJFOLDER)
      gcc $(foreach d, $(INC), -I$d) -c $&lt; -o $@
  
  .PHONY: clean
  
  clean :
      rm -f $(OBJFOLDER)/*.o $(OUTPUTFOLDER)/$(PLUGNAME)$(EXT)                             $(SOURCEFOLDER)/TSDRPlugin.h
  </code></pre>
  
  <p>When I do <em>make all</em> it fails</p>
  
  <pre><code>make: *** No rule to make target `bin/obj/my_lib.o', needed by `bin/
  my_lib.dll'.  Stop.
  </code></pre>
  
  <p>I have no idea how this could be possible since I already have defined</p>
  
  <pre><code> $(OBJFOLDER)/%.o: $(SOURCEFOLDER)/%.c $(_DEPS)
  </code></pre>
  
  <p>Strangely if I change the above line in the <em>makefile</em>, to</p>
  
  <pre><code> bin/obj/my_lib.o: $(SOURCEFOLDER)/%.c $(_DEPS)
  </code></pre>
  
  <p>I now get</p>
  
  <pre><code> make: *** No rule to make target `src/%.c', needed by `bin/obj/my_lib.o'.  Stop.
  </code></pre>