check: make new version work on windows

* include time.h a couple of times
* don't link librt when not using fork
* add HAVE_FORK to AM_CONDITIONAL