fixes for make distcheck

Use `make distcheck` during travis-ci builds and include a couple other fixes to ensure `make distcheck` works in the current code.