Makefile refactoring