diff --git a/Makefile b/Makefile
index cc14745..546d8ee 100644
--- a/Makefile
+++ b/Makefile
@@ -429,11 +429,12 @@ IPA_OBJS = \
 	${IPA_DEPFILES}
 
 IPA_LIB = libinproctrace.so
+INTERNAL_IPA_LDFLAGS = $(sed -i "s/-static//g" "${INTERNAL_LDFLAGS}")
 
 $(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
 	$(SILENCE) rm -f $(IPA_LIB)
 	$(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
-		-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+		-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_IPA_LDFLAGS) \
 		-o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
 
 # Put the proper machine-specific files first, so M-. on a machine