diff --git a/configure b/configure
index 9e4848e4773ff9af7d4b826c77f36d6008ff7951..65fbb71070cadfcb2949974d74515bf8158834a8 100755
--- a/configure
+++ b/configure
@@ -6735,6 +6735,10 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 program_transform_name_sh=$(echo "${program_transform_name}" | sed 's:\$\$:$:g')
 program_name=$(echo plumed | sed "$program_transform_name_sh")
 
+if test "$(echo "$program_name" | tr 'A-Z' 'a-z')" != "$(echo "$program_name" | tr 'A-Z' 'a-z' | sed 's/kernel$//')" ; then
+  as_fn_error $? "$program_name is not a valid program name (should not terminate with Kernel)" "$LINENO" 5
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: **** PLUMED will be installed using prefix $prefix" >&5
 $as_echo "$as_me: **** PLUMED will be installed using prefix $prefix" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}: **** You can change this later using \"make install prefix=/path\"" >&5
diff --git a/configure.ac b/configure.ac
index e6190845131c95280140dbd281388ea6962445ab..4e9b2ad5a1740bea61a6d3ad7c6dc4b871648acc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -629,6 +629,10 @@ AC_ARG_PROGRAM
 program_transform_name_sh=$(echo "${program_transform_name}" | sed 's:\$\$:$:g')
 program_name=$(echo plumed | sed "$program_transform_name_sh")
 
+if test "$(echo "$program_name" | tr '[A-Z]' '[a-z]')" != "$(echo "$program_name" | tr '[A-Z]' '[a-z]' | sed 's/kernel$//')" ; then
+  AC_MSG_ERROR([$program_name is not a valid program name (should not terminate with Kernel)])
+fi
+
 AC_MSG_NOTICE([**** PLUMED will be installed using prefix $prefix])
 AC_MSG_NOTICE([**** You can change this later using "make install prefix=/path"])
 AC_MSG_NOTICE([**** Executable will be named $program_name])