added linking options for thread