Makefile refactoring

Start to change makemake.py into a dependency generator, instead of generating a whole makefile.