diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index 0d5335c3b4ee848f9ca0898542a04a5374ec8277..71886b1b5232d782fa9697d2f4736e391f96920f 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -270,9 +270,9 @@ fi
 if [ "${OSNAME}" == "linux" ]; then
   # Temporary hack to get building done right with gcc-5 compilers
   if [ -z "${CFLAGS}" ]; then
-    CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
+    CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -pthread"
   else
-    CFLAGS="${CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0"
+    CFLAGS="${CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0 -pthread"
   fi
 else
   CFLAGS=""
@@ -310,10 +310,3 @@ if [ -z "${CI_BUILD_TAG}" ]; then
 else
   log_info "Building tag, not setting BOB_DOCUMENTATION_SERVER"
 fi
-
-# Patches conda environment
-log_info "Patching build flags to provide for conda..."
-CFLAGS="${CFLAGS} -pthread"
-export_env CFLAGS
-CXXFLAGS="${CXXFLAGS} -pthread"
-export_env CXXFLAGS