Optimize makefiles