package hdf5: enable shared builds and detection of pthreads and zlib