Factor $(shell ...) stuff into ad-hoc generated Makefiles

Now we do not depend on GNU make supporting $(shell ...) anymore.