configure: improve wayland check