If OpenSSL is available Courier-IMAP can provide secure IMAP access. Normally, if the configuration scripts detects that any one of these external libraries is installed, the appropriate code will be automatically compiled and installed. The same applies for OpenLDAP, MySQL, and any other library. The configuration script does not maintain a list of all the non-standard locations where various libraries get installed by default, because that's subject to change at any time. If you have the library installed, it is possible that it is installed in a non-standard location.
Configuration script fails in the gdbmobj or bdbobj subdirectory.
The corresponding library is installed in a non-standard location.