--- configure.orig	2015-04-02 09:04:58 UTC
+++ configure
@@ -20382,12 +20382,6 @@ $as_echo "#define HAVE_NOTIFY1 1" >>conf
 	fi
 fi
 
-case "$host_os" in
-	*freebsd*)
-		LDFLAGS="$LDFLAGS -pthread"
-	;;
-esac
-
 case "$host_cpu" in
 	*arm*)
 
@@ -22149,7 +22143,7 @@ fi
 
 	fi
 	if test "$found_sqlite" = "yes"; then
-		SQLITE3_CFLAGS+="-DMSG_STORAGE_ENABLED"
+		SQLITE3_CFLAGS="$SQLITE3_CFLAGS -DMSG_STORAGE_ENABLED"
 		if test "$build_macos" = "yes" -o "$ios_found" = "yes"; then
 			SQLITE3_LIBS+=" -liconv"
 		fi
