You need to go to your $MINGW_INSTALL_DIR/bin, find libgcc_s_sjli.dll, and copy it to the folder the exe is in.
When running the program from within Code::Blocks or whatever IDE, it generally has your paths set up correctly for running, but outside of the IDE, Windows uses the default PATH, which generally doesn't include your mingw install. So you have to copy the dlls needed from there, to the same folder as the exe, to distribute your program.