I think, the word "何となく" means as below
somehow or other; for some reason or another;
However, how it has been formed so that it means like above?
何となく is made up of:
As a whole it means "without 'what'", or in more understandable English "without naming what (it is)", thus comes to represent a feeling that you can't pinpoint the specific reason.
Note that this phrase is already an idiom, with an undivided accent なんとなく{LHHHL} instead of etymological なんと{HLL}なく{HL}.
Similar constructions: