Fix building on Linux

Fix the build process to take into account UNIX permissions and case-sensitive filenames.