Makefile: add NEEDS_LIBRT to optionally link with librt