Makefile refactor