compile.sh: refactor checkfail
checkfail function cannot work with set -e
at the beginning of the
script: every command that will return != 0 will stop the script.
This commit replaces checkfail with a || fail "..." function (to keep error explanations)