Makefile: Shared library support

Fixes #29.

Signed-off-by: Pekka Enberg <penberg@iki.fi>