Reorganize dependencies for static/shared

- shared library
  - always build
  - preferably from shared hdf5 ('NiX philosophy)
  - build from static hdf5 is possible (fallback)
  - external dependencies: -lhdf5 -lpthread -lz -lrt -ldl -lm
- static library
  - only build from static hdf5
  - only left external dependencies: -lpthread -lz -lrt -ldl -lm
    (`h5c++ -show`)