/usr/lib/x86_64-linux-gnu/libungif.so is in libgif-dev 4.1.6-9ubuntu1.
This file is owned by root:root, with mode 0o777.
It is a symlink to /usr/lib/x86_64-linux-gnu/libgif.so.4.1.6
/usr/lib/x86_64-linux-gnu/libgif.so.4.1.6