Given the time I have spend solving this problem and all posts I have seen from people with similar problems, still unsolved, I figured a small post on this here might be appreciated.
The two typical errors:
1. configure: error: Cannot find imap library (libc-client.a). Please check your IMAP...