Allow unit testing on Windows
These changes allow testing on Windows using clang.exe.
There are two main changes:
- Only link to -lm when it actually exists on the system
- Create basic versions of pthread_create() and pthread_join() for windows. They are not POSIX compliant by any stretch but will allow any existing and future tests to use pthread_create() and pthread_join() for testing interactions of libomp with os threads.
Differential Revision: http://reviews.llvm.org/D20391