use mktemp instead of tempfile

tempfile is not available on all modern linux systems and is an unnecessary dependency when mktemp will do