Fix rocksdb build dependencies. Implement static linking flags in a more docker elegant way.