configure: fix g++ and glib checks