configure: fixed libraries checking

Checking for libpthread and libatomic_ops fixed.
Checking for associated header files added.
Specific check for pthread_mutex_timedlock added
(the function implementation is NOT required by POSIX).