Yes, you can change the files in any way you wish. There is only one condition for redistributing code licensed under the MIT license:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
In particular, there is no requirement that you include the notices in a particular file or at some particular location in a file.
Some example places to include the required notices are:
For a source code distribution, in a file called LICENSE, LICENSE.MIT, etc.
For an interactive program, in a documentation screen such as "About this application."
For a device, in printed material accompanying the product.
For the particular text you have indicated, this is not a copyright notice in my opinion so it does not need to be preserved:
/*! modernizr 3.6.0 (Custom Build) | MIT *
This string is informational only. It does not contain Copyright YYYY Author, and does not count as a copyright notice. Therefore it is not subject to any requirement of the MIT license. However, even if it were a copyright notice, I would argue that you could still remove it, provided that you comply with the MIT license by including the required notices somewhere else in your distribution, for example in a file such as LICENSE.MIT, or included in an a documentation screen such as "About this application", or included in a printed notice notice accompanying a product you are distributing, or in some other way that is compliant with the license requirements.
EDIT: For use in web applications specifically, please refer to this QA: Where to put license for MIT licensed code on website