lm32 test Makefiles cleanup

Make the makefiles more portable and able to use different toolchain than
lm32-elf (for instance lm32-rtems4.11).

Signed-off-by: Yann Sionneau <yann@minet.net>
Signed-off-by: Michael Walle <michael@walle.cc>
fix compilation of lm32 tests

Fix compiling when using RTEMS toolchain (or any other non-bare-metal
toolchain).

Signed-off-by: Yann Sionneau <yann@minet.net>
Signed-off-by: Michael Walle <michael@walle.cc>