fix linking issue

tested on debian wheezy 64 and ubuntu raring 32