lua: build shared object

Thank you to Rainbowcrypt for reporting