You can generally just assume that they are, unless something tells you otherwise. It would be quite rare to not have libpng and zlib.
However, the bigger question is that you must have several things before you can attempt to compile the software manually, so some questions on that are in order:
1. Do you have command-line (cli/ssh) access to your server? If YES, proceed to the next step. If NO, see if your webhost will install jpegtran, optipng, and gifsicle on your server. If they won’t, your only options are to use the Cloud API or a different webhost.
2. Do you have compile/build utilities available on your server? To test this, login via ssh or however you get command-line access, and run this :
make -h
If you get something like ‘command not found’, then you don’t, and your options are to contact your webhost, use the cloud API, or find a new webhost, unless…
3. Do you have ‘root’ access to your server? If this is standard shared hosting, the answer is always NO. But, if you have some sort of VPS or dedicated server, you may have root access. Root access means you can control all aspects of the server. You can install software, reboot/shutdown the server, etc.