diff --git a/main/Makefile b/main/Makefile
index 95c3c70c6885b62e440fdda1b01bd6f486abb50f..2b7321d4fe7c4ab109ff8fec8b51004e61f7a160 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -363,10 +363,14 @@ binuninstall:
 	rm -f "$(DESTDIR)$(ASTSBINDIR)/$(MAIN_TGT)"
 	rm -f "$(DESTDIR)$(ASTSBINDIR)/rasterisk"
 ifneq ($(ASTSSL_LIB).$(ASTSSL_SO_VERSION),.)
-	rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB).$(ASTSSL_SO_VERSION)"
+#   ASTSSL_SO_VERSION may not exist on Darwin
+	rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB).$(ASTSSL_SO_VERSION)" || :
+	rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB)"
 endif
 ifneq ($(ASTPJ_LIB).$(ASTPJ_SO_VERSION),.)
-	rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTPJ_LIB).$(ASTPJ_SO_VERSION)"
+#   ASTSSL_SO_VERSION may not exist on Darwin
+	rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTPJ_LIB).$(ASTPJ_SO_VERSION)" || :
+	rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTPJ_LIB)"
 endif
 ifneq ($(LDCONFIG),)
 	$(LDCONFIG) $(LDCONFIG_FLAGS) "$(DESTDIR)$(ASTLIBDIR)/"
diff --git a/third-party/Makefile b/third-party/Makefile
index 0aca21e06a38b518cf8c117b716766d69c9a4d3c..f3016f153326b1764a488568ae03c3d8aea3512d 100644
--- a/third-party/Makefile
+++ b/third-party/Makefile
@@ -13,7 +13,7 @@ override MAKECMDGOALS?=all
 MAKECMDGOALS:=$(subst dist-clean,distclean,$(MAKECMDGOALS))
 MAKECMDGOALS:=$(subst tpclean,clean,$(MAKECMDGOALS))
 
-all distclean dist-clean install tpclean : $(TP_SUBDIRS)
+all distclean dist-clean install uninstall tpclean : $(TP_SUBDIRS)
 install uninstall: $(TP_INSTALL_SUBDIRS)
 
 $(TP_SUBDIRS):
diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index 3f50a89b99702b5b73aebcf05a4dac3f6f011e55..21bdf235e84a010c42f740946f9ada486495b366 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -20,6 +20,11 @@ ifeq ($(findstring clean,$(MAKECMDGOALS)),clean)
     SPECIAL_TARGETS += clean
 endif
 
+ifeq ($(findstring uninstall,$(MAKECMDGOALS)),uninstall)
+    SPECIAL_TARGETS += uninstall
+endif
+
+
 ifneq ($(wildcard ../../makeopts),)
     include ../../makeopts
 endif
@@ -62,9 +67,12 @@ ifeq ($(SPECIAL_TARGETS),)
             source/pjsip-apps/src/python/_pjsua.so: LDFLAGS += -L$(PJDIR)/pjsip-apps/lib -Wl,-whole-archive -lasterisk_malloc_debug -Wl,-no-whole-archive
             source/pjsip-apps/src/python/_pjsua.so: source/pjsip-apps/lib/libasterisk_malloc_debug.a
         endif
-        TARGETS += pjproject.symbols
-        export CFLAGS += $(CF)
+        ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
+            CF += -O3
+        endif
+        export CFLAGS += $(CF) -g3
         export LDFLAGS += $(CC_LDFLAGS)
+        TARGETS += pjproject.symbols
     else
         all install:
     endif