--- Makefile.in
+++ Makefile.in
@@ -42,6 +42,7 @@
 COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS)
 SRTPLIB	= -lsrtp
 
+AR	= $(subst ranlib,ar,@RANLIB@)
 RANLIB	= @RANLIB@
 INSTALL	= @INSTALL@
 
@@ -102,7 +103,7 @@
 srtpobj = srtp/srtp.o srtp/ekt.o
 
 libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi)
-	ar cr libsrtp.a $^
+	$(AR) cr libsrtp.a $^
 	$(RANLIB) libsrtp.a
 
 # libcryptomath.a contains general-purpose routines that are used to
@@ -112,7 +113,7 @@
 cryptomath = crypto/math/math.o crypto/math/gf2_8.o 
 
 libcryptomath.a: $(cryptomath)
-	ar cr libcryptomath.a $(cryptomath)
+	$(AR) cr libcryptomath.a $(cryptomath)
 	$(RANLIB) libcryptomath.a
 
 
