Do not include cpppath/extrapath/libpath when generating output location

Otherwise, if libraries are used which have deeper paths, the ouput path
becomes really long and builds fail due to excessively long command line.