add DBG variable for aldor compiler

e.g.: omake DBG='gdb --args'
actually check whether libraries can be linked
use static. instead of .STATIC where possible