--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@
 
 AM_INIT_AUTOMAKE([1.10 no-define subdir-objects foreign])
 
-if test X$CXXFLAGS = X;then
+if test X"$CXXFLAGS" = X;then
    CXXFLAGS="-std=c++11 -g -O2"
 fi
 AC_PROG_CXX