Fixed makefiles to use GMake templates better