Rearrange build to accomodate external shared libraries