I experienced a problem when adding IMAP support into PHP. The php configure script would die when trying to see if "IMAP Works..." and the config.log would complain about libc-client.a references.
It was similar to the problem reported here:
I resolved it by compiling IMAP like this (replace <ARCH> with the proper OS type for your system, get that from the top of the Makefile):
make <ARCH> SSLTYPE=none
That turned off the SSL support in the IMAP files and seemed to resolve my php compile problem.
BTW, I also followed the directions about making a new /usr/local/imap... directory that are mentioned at the top of the page.