Restructured makefile