Makefile restructured and improved