Adding some adjusts to run properly on Linux

There are some adjusts to make the build script more generic, as some fixes on the linux Makefiles for libcocos2d-x and for the samples