diff --git a/mex/build/matlab/configure.ac b/mex/build/matlab/configure.ac
index 27682ced85c7a616445556304fdaeb6b074d90f1..ab17ac9846c802d2a5063450b5a99a5920f2e29e 100644
--- a/mex/build/matlab/configure.ac
+++ b/mex/build/matlab/configure.ac
@@ -66,11 +66,11 @@ AM_PROG_AR
 
 case ${host_os} in
   *darwin*)
-    string="`$CXX --version`"
-    if test x"${string#*clang}" != x"$string"; then
+    string=$($CXX --version)
+    if test "${string#*clang}" != "$string"; then
       CXXFLAGS="$CXXFLAGS -stdlib=libc++"
       MATLAB_LIBS="$MATLAB_LIBS -lc++"
-      MATLAB_LDFLAGS="$MATLAB_LDFLAGS -Wl,-syslibroot,`xcrun -sdk macosx --show-sdk-path`"
+      MATLAB_LDFLAGS="$MATLAB_LDFLAGS -Wl,-syslibroot,$(xcrun -sdk macosx --show-sdk-path)"
     else
       MATLAB_LIBS="$MATLAB_LIBS -lstdc++"
     fi