Adding some better checks to configure.ac for external dependencies.