Fix problems when building after distclean.