Fix makefile for ubuntu
- add ubuntu LDFLAGS
- add pkg-config based lua luajit detection
- add os based sed syntax