If you have the source code for a module, there are multiple ways to compile it.
If you still have ZNC's source around, compiling a new module is a really simple thing to do.
If you don't have ZNC's source around, but installed it (or installed from your distribution's package manager), you don't have to worry. There is a tool called znc-buildmod.
znc-buildmod is installed to the same directory to which
znc is installed, so you might have to change into that directory and use
So once you got <modulename>.so, what should you do with this file? The easiest solution is moving or copying that file to ~/.znc/modules. If you use a different datadir than ~/.znc, move it there in the modules directory. If you don't know what a datadir is, just use ~/.znc/modules.
If you upgrade your ZNC version you must recompile all your modules.