DOCS: adjusted generate script to handle it being run from different
folders and made it autocreate the build folder