I am on redhat and working on a webpage which needs to authenticate user through AD using PHP. I am trying to install LDAP and gets the following error when I run 'make':

(cd .libs && rm -f libldap.so && ln -s libldap-2.2.so.7.0.8 libldap.so)
ar cru .libs/libldap.a bind.o open.o result.o error.o compare.o search.o contro
ls.o messages.o references.o extended.o cyrus.o modify.o add.o modrdn.o delete.o
abandon.o sasl.o sbind.o kbind.o unbind.o cancel.o filter.o free.o sort.o passw
d.o whoami.o getdn.o getentry.o getattr.o getvalues.o addentry.o request.o os-ip
.o url.o sortctrl.o vlvctrl.o init.o options.o print.o string.o util-int.o schem
a.o charray.o tls.o os-local.o dnssrv.o utf-8.o utf-8-conv.o version.o
ranlib .libs/libldap.a
creating libldap.la
(cd .libs && rm -f libldap.la && ln -s ../libldap.la libldap.la)
cc -g -O2 -I../../include -I../../include -c -o apitest.o apitest.c
/bin/sh /data/openldap-2.2.15/libtool --mode=link cc -static -g -O2 -o apite
st apitest.o libldap.la ../../libraries/liblber/liblber.la ../../libraries/liblu
til/liblutil.a -lssl -lcrypto -lresolv
cc -g -O2 -o apitest apitest.o ./.libs/libldap.a /data/openldap-2.2.15/librarie
s/liblber/.libs/liblber.a ../../libraries/liblber/.libs/liblber.a ../../librarie
s/liblutil/liblutil.a -lssl -lcrypto -lresolv
./.libs/libldap.a(tls.o): In function `tls_report_error':
/data/openldap-2.2.15/libraries/libldap/tls.c:1564: undefined reference to `ERR_
error_string_n'
collect2: ld returned 1 exit status
make[2]: *** [apitest] Error 1
make[2]: Leaving directory `/data/openldap-2.2.15/libraries/libldap'
make[1]: *** [all-common] Error 1
make[1]: Leaving directory `/data/openldap-2.2.15/libraries'
make: *** [all-common] Error 1

Please help! Also, do I need to install BDB in order to do the authentication? Thanks a lot!