Refactored makefile with automatic variables