ref
1960s: of unknown origin.
Back-formation from wacky.
wack (n.)
"crazy person," 1938, back-formation from wacky. Adjective in slang sense of "worthless, stupid," is attested from late 1990s.