Ensured that $TEST_LDFLAGS includes -pthread -lrt on Linux.
Added a --disable-semaphore configuration option (for Mac OS X).