$ grep X_PRE_ config.log X_PRE_LIBS=' -lSM -lICE' X_PRE_LIBS is set by the standard autoconf macro AC_PATH_XTRA, invoked by modules/clx/new-clx/configure if you want, you can try to replace AC_PATH_XTRA with AC_PATH_X, regenerate configures &c and see if it still works.