Lots of build cleanups so that "make distcheck" passes