The configure script tests the installed c compiler with a simple compilation test. It always fails, saying ld cannot find -lXm. The Xm library (along the others) exists in the specified directory (specified by the -L linker option)
configure:2062: gcc -L/usr/X11R6/lib conftest.c -lXm -lXt -lX11 -lXext -lXp -lm -lc >&5
/usr/bin/ld: cannot find -lXm
collect2: ld returned 1 exit status