fix compilation on older systems where ld needs strict ordering of libs on the command line

on such systems, `-lm -ldl` must be passed *after* the objects which refer them
ignore .lo (Lua object) files