Only use OLD_LIBS with shared libraries.
Use OLD_FILES for a few symbolic links and static libraries previously
included in OLD_LIBS.
Add a missing shared library major number to an old libroken entry.
(cherry picked from commit 60a8277413eca3fa57f85caf331b080aee030fe5)