Use mkstemp() and handle /usr/lib64 in imake.c