Added exclusion of link to dl when building on BSD