Check for function from libX11 when trying to find it via AC_CHECK_LIB
Check for a function provided by libX11 in AC_CHECK_LIB
checking for main is not ideal, since its not a function from libX11
moreover with newer versions of autoconf this will start to fail [1], so
change this to use XFree API which is provided by libX11 and seems more
relevant to check here.
[1] https://lists.gnu.org/archive/html/autoconf-patches/2022-08/msg00018.html