diff --git a/configure b/configure
index f3bbe3e1d7909a659225226039bb1efda34d8ae8..fe48052515ffa9902ca4ec484291d068f2c810df 100755
--- a/configure
+++ b/configure
@@ -13633,7 +13633,7 @@ if test "x${LKT_DEBUG_ENABLED}" = "xyes" ; then
 else
     BASEFLAGS="${BASEFLAGS} -O3"
 fi
-CFLAGS="${BASEFLAGS} -std=c11"
+CFLAGS="${CFLAGS} ${BASEFLAGS} -std=c11"
 
 #################################
 # BUILD WITH THE DEPENDS SCRIPT #
@@ -13685,7 +13685,8 @@ fi
 
 
 
-    CFLAGS="${CFLAGS} -I$PWD/depends_install/include -L$PWD/depends_install/lib"
+    CFLAGS="${CFLAGS} -I$PWD/depends_install/include"
+    LDFLAGS="${LDFLAGS} -L$PWD/depends_install/lib"
 
     # Download and build dependencies
     cd $LKT_PATH_SOURCE
diff --git a/configure.ac b/configure.ac
index d9accc8930be95f090330db1ef732751dcebc752..be43146c6a8e85fffb0bada97d3bba10156e1d60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,7 +130,7 @@ if test "x${LKT_DEBUG_ENABLED}" = "xyes" ; then
 else
     BASEFLAGS="${BASEFLAGS} -O3"
 fi
-CFLAGS="${BASEFLAGS} -std=c11"
+CFLAGS="${CFLAGS} ${BASEFLAGS} -std=c11"
 
 #################################
 # BUILD WITH THE DEPENDS SCRIPT #
@@ -145,7 +145,8 @@ AM_CONDITIONAL([LKT_DEPENDS_ENABLE], [test "x${LKT_BUILD_DEPENDS}" = "xyes"])
 if test "x$LKT_BUILD_DEPENDS" = "xyes" ; then
     LKT_LIB_DIR="$PWD/depends_install/lib"
     AC_DISABLE_SHARED
-    CFLAGS="${CFLAGS} -I$PWD/depends_install/include -L$PWD/depends_install/lib"
+    CFLAGS="${CFLAGS} -I$PWD/depends_install/include"
+    LDFLAGS="${LDFLAGS} -L$PWD/depends_install/lib"
 
     # Download and build dependencies
     cd $LKT_PATH_SOURCE
diff --git a/depends/rules.txt b/depends/rules.txt
index 19275750965d398357e5f47b31149aa7a89233ae..b5be0f653af591c303fdd3064eb031b550327d75 100644
--- a/depends/rules.txt
+++ b/depends/rules.txt
@@ -2,5 +2,5 @@ zlib        zconfigure  	--static --64
 iconv       configure   	--disable-shared
 openssl		sslconfigure	no-shared -fPIC no-hw
 sqlite3     configure   	--disable-shared --disable-tcl CFLAGS=-fPIC --enable-update-limit
-sdl2        configure   	--disable-shared --enable-fcitx --enable-input-tslib=no CFLAGS=-fPIC --enable-joystick=no
+sdl2        configure   	--disable-shared --enable-fcitx --enable-input-tslib=no CFLAGS=-fPIC
 libcurl     configure   	--disable-shared --without-zlib --enable-optimize --disable-rt --disable-pop3 --disable-imap --disable-rtsp --disable-smtp --disable-smb --disable-smbs --disable-dict --disable-tftp --enable-https --enable-http --enable-mime --disable-threaded-resolver --without-zsh-functions-dir --without-fish-functions-dir --with-ssl=__BUILD_DIR__ --with-zlib=__BUILD_DIR__
diff --git a/scripts/depends.bash b/scripts/depends.bash
index 237550d8f5e455df995dc9e6321be524317ead22..28edb7b1a829f5e4401ea83cfdad3a82b24fd1ff 100755
--- a/scripts/depends.bash
+++ b/scripts/depends.bash
@@ -155,13 +155,13 @@ do
         zconfigure)
             # The CC= and CXX= doesn't work for zlib
             # TODO pour le Kubat du futur: trouver un moyen uniforme de passer le '-fPIC'
-            CFLAGS="-fPIC" $ROOT_DIR/depends/$FOLD/configure --prefix=$ABS_BUILD_DIR/depends_install $OPT
+            CC=$CC CXX=$CXX CFLAGS="-fPIC" $ROOT_DIR/depends/$FOLD/configure --prefix=$ABS_BUILD_DIR/depends_install $OPT
             [ $? -ne 0 ] && die "Failed to configure $FOLD"
             ;;
         sslconfigure)
             # Yes, we need to call Configure and not configure here...
             # TODO pour le Kubat du futur: trouver un moyen de pas ardcoder le linux-x86_64 (build FreeBSD, OSX et autres)
-            $ROOT_DIR/depends/$FOLD/Configure --prefix=$ABS_BUILD_DIR/depends_install $OPT linux-x86_64
+            CC=$CC CXX=$CXX $ROOT_DIR/depends/$FOLD/Configure --prefix=$ABS_BUILD_DIR/depends_install $OPT linux-x86_64
             [ $? -ne 0 ] && die "Failed to configure $FOLD"
             ;;
     esac