So, unistalling the installed php5-imap package with 'apt-get remove', before doing the build seems to fix that.
So, unistalling the installed php5-imap package with 'apt-get remove', before doing the build seems to fix that.