https://bugs.openldap.org/show_bug.cgi?id=9663
--- Comment #1 from Ryan Tandy ryan@openldap.org --- OpenLDAP 2.5.x builds fine in Debian experimental with back_perl enabled:
https://buildd.debian.org/status/fetch.php?pkg=openldap&arch=amd64&v...
Therefore I would assume as a starting point the issue is with your build environment, and not a bug in the software.
I'm not familiar with RHEL specifically, but if you installed the proper devel packages, it should build without needing to override *FLAGS for configure.
Please follow up on the openldap-technical mailing list if you want to discuss or troubleshoot this further.