makefiles: Use AS_MKDIR_P to create the extra directories.