Hello,
At this Teltonika Networks Wiki link, you can find all the information and steps needed to build a custom firmware, just one piece of advice, try to follow the instructions inside the README file inside the sdk, it has updated instructions a little different from the ones you can find at the wiki page. Also try to use the recommended version of Ubuntu, in this case, 18.04.
Try to check that every package that you have to install before starting the build of the sdk is installed correctly, it is really easy to miss something, and in case a package was not installed correctly, try different versions of that package.