Autotools fix revisited

Cleaned up version of the autogen-to-cleanup-branch.

* Split up the bigger commit.
* No AM_MAINTAINER_MODE
* Static libs also get built.