CMakeLists.txt: Add possibility to build library as shared
This adds the option to build the soem library also as shared object.
Note that the default is untouched, so by default, it will still build
a static library.
The [BUILD_SHARED_LIBS](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html)
is the standard way of doing it, many tools use this semantics to influence
the output to be the desired type (whichever you want).