Fix compilation when --as-needed is used during linking

Change should allow to build lua-geoip with --as-neeed flag.