Basic Markov Chain Algorithm
Use std::random_device instead of time()
Stay within C++, and use a real random device to seed the generator, like so:
std::random_device rd;
std::mt19937 generator{rd()};

Consider turning Randomiser into an anonymous namespace
Does this namespace need a name? If only getRandomNumber() uses Randomiser::generator, and it's in the same source file, you can make it an anonynous namespace instead, just omit &quot;Randomiser&quot;.
Be consistent with types
Avoid mixing types like int and size_t. It might seem to work fine, but it is easy for errors to happen this way. Before changing types, consider that sometimes you don't really need to specify a type explicitly, and can instead use template&lt;&gt; or auto. For example:
template&lt;typename T&gt;
auto getRandomNumber(T min, T max)
{
    std::uniform_int_distribution&lt;T&gt; rand{ min, max };
    return rand(Randomiser::generator);
}

However, you will now get some compiler errors, because you were actually calling getRandomNumber() with min and max having different types, like in:
int randomNumber{ getRandomNumber(0, m.size()) };

This is actually a good thing, the compiler is telling you something fishy is going on. In fact, m.size() returns a size_t, which can be bigger than what an int can hold on most 64-bit platforms, as well as being unsigned instead of signed. Considering that min is always 0 in your code, I would instead write:
template&lt;typename T&gt;
auto getRandomNumber(T max) {
    std::uniform_int_distribution&lt;T&gt; rand{ 0, max };
    return rand(Randomiser::generator);
}

...

auto randomNumber = getRandomNumber(m.size());

Note that you probably meant getRandomNumber(m.size() - 1) here. This brings me to:
Consider writing a getRandomElement() function
You actually use the random numbers to pick random elements out of containers. So write a function to do exactly that:
template&lt;typename T&gt;
static auto &amp;getRandomElement(const T &amp;container)
{
    std::uniform_int_distribution&lt;size_t&gt; rand{ 0, container.size() - 1 };
    return *std::next(std::begin(container), rand(Randomiser::generator));
}

Simplifying markovIt()
Now that we have the above, we can simplify markovIt() greatly. It can be rewritten as:
void markovIt(const std::map&lt;std::string, std::vector&lt;std::string&gt;&gt;&amp; m)
{
    // Get the initial word
    auto word = getRandomElement(m).first;

    for (int i = 0; i &lt; 255; ++i)
    {
        std::cout &lt;&lt; word &lt;&lt; &quot; &quot;;

        // Find the entry in m that matches word
        auto entry = m.find(word);
        if (entry == m.end())
            break;

        // Select a random word from the list of possibilities
        word = getRandomElement(entry-&gt;second);
    }
}

Move special cases out of loops if possible
While loading story.dat, you use the variable i do determine if you need to push back the first word. You can move that special case outside of the loop. The compiler will probably do this for you even if you don't, but it also cleans up the code if you do so in this case:
wordStream &gt;&gt; fword;
wordStream &gt;&gt; sWord;
gram[fWord].push_back[sWord];

while(wordStream)
{
    wordStream &gt;&gt; fWord;
    gram[sWord].push_back(fWord);
    wordStream &gt;&gt; sWord;
    gram[fWord].push_back(sWord);
}

However, why read two words in each loop iteration? You can rewrite this to:
wordStream &gt;&gt; fWord;

while(wordStream)
{
    wordStream &gt;&gt; sWord;
    gram[fWord].push_back(sWord);
    fWord = sWord;
}

Move more functionality into functions
You are doing too much inside main(). Move more functionality into functions, and keep main() as high-level as possible. For example:
static auto load_gram(const std::string &amp;filename)
{
    std::map&lt;std::string, std::vector&lt;std::string&gt;&gt; gram{};
    std::ifstream wordStream{ filename };

    // load the data into gram here
    ...

    return gram;
}

int main(int argc, char *argv[])
{
    auto gram = load_gram(&quot;story.dat&quot;);
    markovIt(gram);
}