(almost) fix distcheck

This series of build changes gets distcheck to pass if I disable the actual tests, since some of them fail on my system.