fix syntax error in configure shell script

strangly enough, it seems to work like it was in some circumstances...
Merge pull request #439 from andlaus/fix_configure_syntax_error

fix syntax error in configure shell script
configure: fix all except one warning produced by shellcheck

thanks to @bska for pointing this tool out!
Merge pull request #440 from andlaus/fix_shellcheck_warnings

configure: fix all except one warning produced by shellcheck