Merge pull request #142 from paulfertser/master

Makefile: add -lc to make debug build with -nostartfiles happy
Fix more warnings to make it pass -Wextra -Wshadow -Wunsafe-loop-optimizations

Signed-off-by: Paul Fertser <fercerpav@gmail.com>