diff --git a/Makefile b/Makefile
index 3a1ecb6829e81e41277a83940555829727fc11c3..910ffca3b66d7490e45e64c5e36d8061acc2195b 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ test_pam_goatherd: goatherd pam_goatherd.so test_pam_goatherd.sh
 test: test_pg test_pam_goatherd
 
 pam_goatherd.so: pam_goatherd.o
-	$(LINK.c) -lpam -lgnutls -Wl,-soname,$@ -shared $< -o $@
+	$(LINK.c) $< -o $@ -lpam -lgnutls -Wl,-soname,$@ -shared
 
 clean:
 	rm -f pam_goatherd.o pam_goatherd.so goatherd