build: Clean up configure.ac and fix make (dist)check