Several configury updates

This PR contains several commits:

* If the m4 directory does not exist, create it
* Fix test/Makefile.am
* Fix src/Makefile.am
* Revamp the SSL configure logic