refactor makefiles