Improved makefile with ordered restructuring