Fix the test code to be independent from the file hierarchy
Detect linux in makefile to add the -lrt library build flag