Refactored makefile