slim: build fixes

Two patches are pretty obvious.
The library order is needed to build successfully with -Wl,--as-needed
Merge pull request #119 from v4hn/slim

slim: build fixes