Leptonica sometimes assumes the presence of standard Unix/Linux command line utilities (like rm, diff, sleep). The easiest way to handle this under Windows is to install the Cygwin Linux-like Environment for Windows. You’ll probably only need the base | coreutils package and the simplest thing is just to use the initial setup defaults which installs only the “minimal base packages”.