set proper shared lib soname on Linux/Unix

What's the purpose of this check (and the other)?