Fix compilation with old GLib.

Usage of g_slist_free_full() requires #include "glib-compat.h"
Fix compilation for --without-gtk.

Adding AM_CONDITIONAL to not compile GTK modules in that case.