Hello,
I'm not sure if I understood your post right: You have openldap libraries
installed and would like to link another program/library with them. This
is the relevant part from my Makefile:
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
LIBS=-lc -lldap -llber -lssl -lcrypto
I was able to compile my program with both vac and gcc on v4.3 and v5.1.
The openldap libraries are static so I didn't have to do anything special
to get a program which includes the LDAP code (I suppose that that is your
objective). If the libraries are shared objects on your computer, then
using the "noautoimp" ld option should help. I guess that you should read
the ld(1) man page to get precise information about linking.
Hth,