Autotools cleanup

Cleanup of generated files and unnecessary tests from autotools stuff. I also added the `foreign` option that I mentioned in b809103. Also, make the default makefile more correct.