Fix makefile

I simplified your makefile so that it works as expected. See the commit message for a long explanation.