refactoring of build process

I made some minor refactorings to the build process so it is easier to use regarding different linux distributions.