Common objects should be in shared library

Changing Makefile to compile common objects into a shared library.

Signed-off-by: Olli Vanhoja <olli.vanhoja@cs.helsinki.fi>