Fix/clean up building and installing shared libraries

Please see each individual commit for an explanation on what it does and what issue it fixes.

Review at https://rbcommons.com/s/OpenH264/r/955/.