Simplify buildsystem and fix configure errors