Makefile overhaul

I finally brought myself to refactor the Makefile to fix some of the annoyances I had with the current Makefile. Hope this helps others as well.