simplify library finding and ccall usage