build: libtoolize bitcoin core

Minimal changes to make it possible to build shared libraries from Bitcoin Core:

- `libbitcoincore_server.so.1`
- `libbitcoincore_wallet.so.1` (if --enable-wallet)
- `libbitcoincore_cli.so.1`
- `libbitcoincore_common.so.1`

Libtool automagically adds `--enable-shared` and `--enable-static` options. Bitcoind and the other executables link against the shared libraries if available.

This is a step towards being able to split off the wallet or in general to make it possible to develop other Bitcoin-based stuff outside the core repository. It is a minimal change contained to the build system. The current division into libraries may not be ideal for external usage, this can be improved later.

Default behaviour should be unchanged: building shared libraries is disabled by default.
One step in implementing #3882 .