modtool: added skipping of lib/ and swig/ if sources list is empty

Reviewed and slightly modified by me.