totally refactored Makefile