Makefile: Factor out common build arrangements for hacks.