Clean up Makefiles.
Fix "make dist".

Fixes #4489