Switch to using libbsd for shim

A small script is used for checking if we need to include -lbsd