Fixed static linking and added support for static runtime library.
Merge remote-tracking branch 'exp/static_runtime'