/bin/sh is actually a symlink to /bin/dash in Kubuntu which seems to have some problems running "sh" scripts.The solution is to create a symlink to
/bin/bash instead.
$ sudo rm /bin/sh
$ sudo ln -s /bin/bash /bin/shI faced the same problem while compiling the LTIB on my machine.