Check if input file could be opened.
Improved build script.

The debian build has been changed to not use dh_auto_build etc. because they
pick up the CMake files instead of using the Makefiles.