Manually look for libs on Linux

Also, replace check_output for 2.6.