Don't repeat the mkdir for every compile and link. Instead do it once, iff necessary.