It is linking problem - you have to specify all libraries, you have used functions from. In this case - link also with -lzlib - lpthread options.
For the all similar problems - google function on which you get an error and find to which library it belongs. Then link to it.