Patch for building against Qt5 on Linux
Add `--disable-gui` option if we don't want GUI.

Tidied up `configure.ac` a bit.