Build Gmsh also as library (fixed)

This request is the corrected version of PR #943 as requested by @goxberry