diff --git a/configure.ac b/configure.ac
index a2539ff04ce06ef89cdac71bdd1e05423948e63e..cabb62559b4b7ef00803a955a3fcdb14718e5ea7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -452,10 +452,11 @@ if test "$enable_opt" = "yes" ; then
    ac_test_CFLAGS="yes"
 
    detected_ax_gcc_arch=`echo $ax_gcc_arch | awk '{print $1;}'`
-   
+   detected_ax_icc_flag=`echo $icc_flags | awk '{print $1;}'`
+
    # Choose the best flags for the gravity sub-library on this compiler and architecture
    if test "$ax_cv_c_compiler_vendor" = "intel"; then
-      if test "$detected_ax_gcc_arch" = "skylake-avx512"; then
+      if test "$detected_ax_icc_flag" = "-xCORE-AVX512"; then
          GRAVITY_CFLAGS="-qopt-zmm-usage=high"
       else
          AC_MSG_WARN([No additional flags needed for gravity on this platform])