fix cmake race condition

I saw this earlier today, and so did someone else on the mailing list.
Merge pull request #153 from linas/racey

fix cmake race condition