errors while running make to build PAM

I am trying to build PAM LDAP on Solaris 2.7 box. I am receiving the
following errors. Does anybody know the reason and fix. Thanks in advance.
"pam_ldap.c", line 164: invalid token in #define macro parameters: ...
"pam_ldap.c", line 1592: left operand of "." must be struct/union object
"pam_ldap.c", line 1593: left operand of "." must be struct/union object
"pam_ldap.c", line 1992: warning: argument #4 is incompatible with
prototype:
prototype: pointer to int : "./pam_ldap.h", line 245
argument : pointer to long
"pam_ldap.c", line 2034: warning: argument #4 is incompatible with
prototype:
prototype: pointer to long : "./pam_ldap.h", line 246
argument : pointer to ulong
cc: acomp failed for pam_ldap.c
Siva Nookala