Just use the official packages from https://nginx.org/en/linux_packages.html#Ubuntu
nginx-module-acme is available there, too, so you don't need to compile it manually.