fixed compiling error by adding pthread and rt explicitly as ldflags for NiViewer