This is one of those fun errors for which you can find lots of search hits that won’t bring any happiness. You’ve seen the error before but the reason you saw it three years ago while building the same open source package may not be the reason you’re seeing it today.
Anyhow, here’s my current blunder: I’m compiling an httpd tarball
using icc on Linux, I forgot to add —with-included-apr, the system
APR is picked up by default, it wasn’t built with the same CC, and
libtool is confused about the CC setting. As I intended to use the
httpd-bundled apr, my fix is to add the extra configure option
—with-included-apr.