After some iterations it turned out that some development packages were missing to compile pycurl.
apt-get install libpython3.7-dev libnss3 libnss3-devThe essential hint for libpython3.7-dev is as follows.
src/pycurl.h:4:10: fatal error: Python.h: No such file or directory This indicates that Python.h is missing or cannot be found. In this case it is a bit difficult to find the correlating package since a lot of packages provide this file. You can use
apt-file search Python.hto search for packages that provide this file. Since you are trying to compile with the system provided Python 3.7 the package, it should also be named something like libpython including the version.
The second hint is as follows.
/usr/bin/ld: cannot find -lssl3This tells you that the linker cannot find the libssl3.so library to link the fresh compiled pycurl objects to. You can also use apt-file search to find packages providing this library. Not sure if the -dev package is also needed here, but it shouldn't matter if you just install it as well.