replace some hardcoded commands in Makefiles with variables