Stop installing profiling libraries as /usr/lib/lib${LIB}_p.a, because
it makes it really hard to support shared profiling. Instead, install
them into /usr/lib/profile and tweak GCC to look there first, when -pg
is given. Also add support for /usr/lib/debug and -g respective. If both
-pg and -g are given, profile has the precedence.
Now that libc.a is always used for the static case, link all shared
objects against libc, too. This makes it easier to detect libc mixing
and can be used for stricter link-time checks in the future.