add library autodetection when compiling