Fix check_lib in configure script (#398)
Merge review 221 by @srh (Fix #398)