--- Makefile.orig	2005-04-25 15:58:19.000000000 -0500
+++ Makefile	2009-12-17 07:22:30.000000000 -0600
@@ -33,7 +33,7 @@
 # If OpenSSL has been installed, append /lib to OPENSSLDIR in the following
 # statement (i.e., use $(OPENSSLDIR)/lib).
 
-SSLLIB = -Wl,-R$(OPENSSLDIR) -L$(OPENSSLDIR) -lcrypto
+SSLLIB = -Wl,-R$(OPENSSLDIR)/lib -L$(OPENSSLDIR)/lib -lcrypto
 
 OBJS = $(ARCH)/asn1help.o \
        $(ARCH)/filehelp.o \
@@ -48,25 +48,25 @@
 	ar -r $(LIB) $(OBJS)
 
 $(SLIB): $(OBJS)
-	gcc -shared -o $(SLIB) $(OBJS) $(SSLLIB)
+	$(CC) -shared -o $(SLIB) $(OBJS) $(SSLLIB)
 
 $(ARCH)/asn1help.o: src/asn1/asn1help.c
-	gcc -c $(CFLAGS) src/asn1/asn1help.c -I$(OPENSSLDIR)/include -o $@
+	$(CC) -c $(CFLAGS) src/asn1/asn1help.c -I$(OPENSSLDIR)/include -o $@
 
 $(ARCH)/filehelp.o: src/file/filehelp.c
-	gcc -c $(CFLAGS) src/file/filehelp.c -o $@
+	$(CC) -c $(CFLAGS) src/file/filehelp.c -o $@
 
 $(ARCH)/gssapi.o: src/gssapi/gssapi.c
-	gcc -c $(CFLAGS) src/gssapi/gssapi.c -I$(OPENSSLDIR)/include -o $@
+	$(CC) -c $(CFLAGS) src/gssapi/gssapi.c -I$(OPENSSLDIR)/include -o $@
 
 $(ARCH)/krb5help.o: src/krb5/krb5help.c
-	gcc -c $(CFLAGS) src/krb5/krb5help.c -I$(OPENSSLDIR)/include -o $@
+	$(CC) -c $(CFLAGS) src/krb5/krb5help.c -I$(OPENSSLDIR)/include -o $@
 
 $(ARCH)/spnego.o: src/spnego/spnego.c
-	gcc -c $(CFLAGS) src/spnego/spnego.c -I$(OPENSSLDIR)/include -o $@
+	$(CC) -c $(CFLAGS) src/spnego/spnego.c -I$(OPENSSLDIR)/include -o $@
 
 $(ARCH)/spnegohelp.o: src/spnego/spnegohelp.c
-	gcc -c $(CFLAGS) src/spnego/spnegohelp.c -I$(OPENSSLDIR)/include -o $@
+	$(CC) -c $(CFLAGS) src/spnego/spnegohelp.c -I$(OPENSSLDIR)/include -o $@
 
 $(OBJS): $(DIRMADE)
 
